package designPattern.creation.prototypepattern;

/**
 * @author 张琪
 * @date 2023/1/30 15:59
 */
public class Client {
    public static void main(String[] args) {
        ShallowClone cp = new ShallowClone();
        ShallowClone cloneCp = (ShallowClone) cp.clone();
        cloneCp.show();
        System.out.println(cp.list.hashCode());
        System.out.println(cloneCp.list.hashCode());
        System.out.println(cloneCp.list == cp.list);

        DeepClone cp2 = new DeepClone();
        DeepClone cloneCp2 = (DeepClone) cp2.clone();
        cloneCp2.show();
        System.out.println(cp2.list.hashCode());
        System.out.println(cloneCp2.list.hashCode());
        System.out.println(cloneCp2.list == cp2.list);
    }
}
